const http = uni.$u.http

// 根据key获取业务参数配置详细信息
export const getByKeyApi = (configKey) => http.get('/business/business/getByKey', { params: { configKey } })
// 查询地区列表
export const getAreaListApi = () => http.get('/system/area/list')
//查询信息列表
export const getInformationListApi = (query) => http.get('/business/information/list', { params: query })
//新增信息
export const addInformationApi = (data) => http.post('/business/information', data)
//新增投诉
export const addComplaintApi = (data) => http.post('/business/complaint', data)
//新增用户收藏
export const addCollectApi = (query) => http.post('/business/collect', query)
//删除用户收藏
export const delCollectApi = (query) => http.get('/business/collect/delete',{ params: query })
//查询用户收藏列表
export const getCollectListApi = (query) => http.get('/business/collect/list', { params: query })
//我的发布列表
export const getInformationList2Api = (query) => http.get('/business/information/list2', { params: query })
//代理审核发布列表
export const getPendingApprovalListApi = (query) => http.get('/business/information/pendingApprovalList', { params: query })
//代理审核发布列表审核
export const reviewAdvertisementsApi = (query) => http.put('/business/information/reviewAdvertisements', query)
//信息详情
export const getListInfoApi = (query) => http.get('/business/information/getInfoById',{ params: query })
//实名认证
export const authenticationApi = (query) => http.put('/business/user/authentication',query)
//查看手机号
export const viewPhoneApi = (query) => http.get('/business/user/viewPhone',{ params: query })

//团队列表
export const getMyTeamApi = (query) => http.get('/business/vip/getMyTeam', { params: query })
//团队下级列表
export const getTeamApi = (query) => http.get('/business/vip/getTeam', { params: query })
//获取地址
export const getAddressApi = (query) => http.get('/business/vip/getAddress', { params: query })
//获取代理下的用户
export const getuserMyTeamApi = (query) => http.get('/business/user/getMyTeam', { params: query })
//积分兑换次数
export const redeemApi = (query) => http.get('/business/user/redeem', { params: query })
// 绑定邀请人
export const bindSuperiorApi = (userId) => http.get('/business/vip/bindSuperior', { params: { userId }, custom: { showSuccess: false, showError: false } });



export const goodsRemoveApi = (query) => http.put('/business/goods/remove', {}, { params: query })
export const goodsUpApi = (query) => http.put('/business/goods/up', {}, { params: query })
export const goodsReceivingApi = (query) => http.put('/business/goods/receiving', {}, { params: query })
export const goodsServedApi = (query) => http.put('/business/goods/served', {}, { params: query })
export const goodsEditApi = (data) => http.put('/business/goods/edit', data)
export const removeByUserApi = (query) => http.put('/business/goods/removeByUser', {}, { params: query })
export const getTimeApi = () => http.get('/business/business/getTime')
//查询任务列表
export const getGoodsListApi = (query) => http.get('/business/goods/list', { params: query })

export const getGoodsApi = (goodsId) => http.get('/business/goods/' + goodsId)

export const addOrderApi = (query) => http.post('/business/order/createOrder', {}, { params: query })

export const topUpApi = (data) => http.post('/pay/topUp', data)

// 获取我的详细信息(商户)
// export const getMyInfoApi = () => http.get('/system/user/getMyInfo')
export const getMyInfoApi = () => http.get('/business/user/getMyInfo')

export const oderListApi = (query) => http.get('/business/order/list', { params: query })

export const removeOderApi = (goodsGoodsIds) => http.delete('/business/order/' + goodsGoodsIds)
export const confirmOrderApi = (orderId) => http.post('/business/order/confirmOrder', {}, { params: { orderId } })
export const resubmitOrderApi = (orderId) => http.post('/business/order/resubmitOrder', {}, { params: { orderId } })

// 修改微信昵称图像
export const updateWxInfo = (nickName, avatar) => http.post('/business/vip/updateWxInfo', {}, { params: { nickName, avatar }, custom: { successMsg: "修改成功" } });
// 购物车
export const addCartApi = (data) => http.post('/business/cart/add', data)
export const addCartByCartApi = (shoppingCartId) => http.post('/business/order/createOrderByShoppingCartId', {}, { params: { shoppingCartId } })
export const getCartApi = (query) => http.get('/business/cart/list', { params: query })

// 提现
export const auditApi = (data) => http.post('/business/audit', data, { custom: { showSuccess: true, successMsg: "操作成功" } })
//流水
export const getFlowingApi = (query) => http.get('/business/flowing/list', { params: query })
export const getAuditListApi = (query) => http.get('/business/audit/list', { params: query })
//任务
export const addGoodsApi = (data) => http.post('/business/goods/add', data, { custom: { showSuccess: true, successMsg: "操作成功" } })
export const updateGoodsStatusApi = (query) => http.put('/business/goods/updateGoodsStatus', {}, { params: query }, { custom: { showSuccess: true, successMsg: "操作成功" } })
export const removeGoodsApi = (goodsIds) => http.delete('/business/goods/' + goodsIds)
export const getUnReadApi = (query) => http.get('/business/message/getUnRead',{ params: query })
export const getRoomListApi = (query) => http.get('/business/message/getRoomList',{ params: query })
export const removeRoomApi = (query) => http.delete('/business/message/removeRoom',{},{ params: query })
export const getMsgListApi = (query) => http.get('/business/message/getMsgList',{ params: query })
export const messageSendApi = (query) => http.post('/business/message/sendByRoomId', {},{ params: query })
export const getRoomIdApi = (query) => http.get('/business/message/getRoomId',{ params: query })
export const takeOrdersApi = (goodsId) => http.put('/business/goods/takeOrders',{},{ params: {goodsId} })
//置顶信息的排序
export const informationRefreshApi = (query) => http.post('/business/information/refresh',{},{ params:query })
//新增广告 修改 审核
export const advertisingApi = (query) => http.post('/system/advertising',query)
//广告审核
export const examineAdvertisingApi = (query) => http.put('/system/advertising/examineAdvertising',query)
//看广告
export const watchAdvertisementsApi = (query) => http.get('/system/advertising/watchAdvertisements',{ params:query })
//获取当前地区下广告次数
export const getCountOfRegionsApi = (query) => http.get('/system/advertising/getCountOfRegions',{ params:query })
//查询广告列表
export const getAdvertisingApi = (query) => http.get('/system/advertising/list',{ params:query })

//成为代理
export const becomeAgentApi = (data) => http.put('/business/user/becomeAgent',data)
//实名审核列表
export const getApprovalListApi = (query) => http.get('/business/user/getApprovalList',{ params:query })
//实名审核列表
export const putUserApi = (data) => http.put('/business/user',data)
//广告审核列表
export const approveListApi = (query) => http.get('/system/advertising/approveList',{ params:query })
// //广告审核
// export const putAdvertisingApi = (data) => http.put('/system/advertising',data)
